package com.huawei.hianalytics.ab.bc.cd.bc;

import android.text.TextUtils;
import com.huawei.hianalytics.ab.bc.ab.bc;
import com.huawei.hianalytics.ab.bc.ab.bc.ab;
import org.json.JSONObject;

public class de implements fg {
    private String ab;
    private String bc;
    private String cd;
    private String de;
    private String ef;
    private String fg;

    public String ab() {
        return this.ab;
    }

    public void ab(String str) {
        this.ab = str;
    }

    public void ab(JSONObject jSONObject) {
        if (jSONObject != null) {
            this.bc = jSONObject.optString("event");
            this.cd = jSONObject.optString("properties");
            this.cd = bc.ab().ab(ab.AES).ab(com.huawei.hianalytics.ab.bc.gh.bc.ab().cd(), this.cd);
            this.ab = jSONObject.optString("type");
            this.de = jSONObject.optString("eventtime");
            this.ef = jSONObject.optString("event_session_name");
            this.fg = jSONObject.optString("first_session_event");
        }
    }

    public String bc() {
        return this.de;
    }

    public void bc(String str) {
        this.bc = str;
    }

    public JSONObject cd() {
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("type", this.ab);
        jSONObject.put("eventtime", this.de);
        jSONObject.put("event", this.bc);
        jSONObject.put("event_session_name", this.ef);
        jSONObject.put("first_session_event", this.fg);
        if (TextUtils.isEmpty(this.cd)) {
            return null;
        }
        jSONObject.put("properties", new JSONObject(this.cd));
        return jSONObject;
    }

    public void cd(String str) {
        this.cd = str;
    }

    public JSONObject de() {
        JSONObject cd = cd();
        cd.put("properties", bc.ab().ab(ab.AES).bc(com.huawei.hianalytics.ab.bc.gh.bc.ab().cd(), this.cd));
        return cd;
    }

    public void de(String str) {
        this.de = str;
    }

    public void ef(String str) {
        this.ef = str;
    }

    public void fg(String str) {
        this.fg = str;
    }
}
